// src/modules/user/dto/update-user.dto.ts
import { ApiProperty } from '@nestjs/swagger';
import { IsOptional, IsEnum, IsBoolean } from 'class-validator';
import { UserStatus } from 'src/entities/user.entity';

export class UpdateUserDto {
  @ApiProperty({
    description: '用户状态',
    enum: UserStatus,
    required: false,
  })
  @IsOptional()
  @IsEnum(UserStatus)
  status?: typeof UserStatus;

  @ApiProperty({
    description: '是否为VIP',
    example: true,
    required: false,
  })
  @IsOptional()
  @IsBoolean()
  isVip?: boolean;

  @ApiProperty({
    description: 'VIP到期时间',
    example: '2024-12-31T23:59:59Z',
    required: false,
  })
  @IsOptional()
  vipExpireAt?: Date;

  @ApiProperty({
    description: '最后登录时间',
    example: '2024-12-31T23:59:59Z',
    required: false,
  })
  @IsOptional()
  lastLoginAt?: Date;

  @ApiProperty({
    description: '最后登录IP',
    example: '127.0.0.1',
    required: false,
  })
  @IsOptional()
  lastLoginIp?: string;
}
